package com.partner.service;

import java.util.List;

import com.partner.dao.TieZiDao;
import com.partner.domain.DianZanCollect;
import com.partner.domain.TieZi;
import com.partner.domain.TieZiMessage;
import com.partner.domain.TieZiReply;
import com.partner.response.TieZiResponse;

public class TieZiService {
	public TieZiDao tieZiDao = new TieZiDao();
	public TieZiResponse getTieZi(int pageNow,int pageSize){
		return tieZiDao.getTieZi(pageNow, pageSize);
	}
	//增加一个帖子的回复
		public int insertReply(TieZiReply tieZiReply){
			return tieZiDao.insertReply(tieZiReply);
		}
		
		//将对应用户的点赞和收藏情况查询出来
		public List<DianZanCollect> getDianzan(String phone){
			return tieZiDao.getDianzan(phone);
		}
		//将对应的点赞记录给删除
		public boolean deleteZan(DianZanCollect dianZanCollect){
			return tieZiDao.deleteZan(dianZanCollect);
		}
		//增加一条点赞记录
		public int insertZanOrCollect(DianZanCollect dianZanCollect){
			return tieZiDao.insertZanOrCollect(dianZanCollect);
		}
		
		//删除一条评论
		public boolean deleteReply(int id){
			return tieZiDao.deleteReply(id);
		}
		
		//查询对应用户的收藏帖子
		public List<TieZi> selectShouCangTieZiForUser(String phone,int pageNow,int pageSize){
			return tieZiDao.selectShouCangTieZiForUser(phone, pageNow, pageSize);
		}
		//查询对应用户发出的帖子
		public List<TieZi> getTieZiForUser(String phone,int pageNow,int pageSize){
			return tieZiDao.getTieZiForUser(phone, pageNow, pageSize);
		}
		//像数据表中插入数据
		public boolean addTieZi(String phone,String content,String time,String img){
			return tieZiDao.addTieZi(phone, content, time,img);
		}
		//查询关于对应用户的帖子消息
		public List<TieZiMessage> getTieZiMessages(String phone,int pageNow,int pageSize){
			return tieZiDao.getTieZiMessages(phone,pageNow,pageSize);
		}
}
